package easycloud.ecs.provider.model.snda;

import java.io.InputStream;

import com.snda.storage.service.model.StorageObject;

import easycloud.ecs.common.domain.Item;
import easycloud.ecs.provider.model.IStorageObject;

public class SndaStorageObject implements IStorageObject {

	private StorageObject object;

	private Item item;

	public SndaStorageObject(StorageObject storageObject, Item item) {
		object = storageObject;
		this.item = item;
	}

	@Override
	public String getHash() {
		return object.getETag();
	}

	@Override
	public Item getItem() {
		return item;
	}

	@Override
	public String getKey() {
		return item.getPath();
	}

	@Override
	public long getLength() {
		return object.getContentLength();
	}

	@Override
	public InputStream getObjectContent() {
		return object.getDataInputStream();
	}
}
